<?
require("config.php");

$location_status .= "| Add";
$show_backnav = "menu";
$menutype = 2;

if (NULL!=$action){

   $field = array(
	"code",
	"course",
	"schedule",
	"graduate",
	"detail",
	"status",
	"showcase","picture1","ccode",
	);

   $content = array(
	$Code,
	$Course,
	$Schedule,
    $Graduate,
	$Detail,
	$Status,
	$showcase,$Picture_name,$Ccode,
	);

   myInsert($table,$field,$content);

$dir = "course_sharing/";

	myUpload($Picture,$Picture_name,$dir);
   header("location:" . $rela_path . "share/msg.php?v=741&id=$parent_id&label=$Schedule");

   exit();

}

if (checkCode($table,$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9001");
	exit();
}


require($rela_path . "inc/header.php");
require($rela_path . "bin/date.php");
require($rela_path . "bin/country.php");
?> 
<form action="" method="post" enctype="multipart/form-data" name="form1">
<!--hidden filed-->
<input name="action" type="hidden" value="add">
<input name="Code" type="hidden" value="<?print($Code)?>">

  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right"> <input name="image" type="image" onclick="Redirect('menu.php?label=<?=$label?>&id=<?=$parent_id?>',1);return false;" src="../../images/bt_cancel.gif" width="78" height="23"> 
        <input name="image" type="image" src="../../images/bt_save.gif" width="76" height="22"  <?print($active)?>> 
      </td>
    </tr>
  </table>
  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right">&nbsp; </td>
    </tr>
    <tr> 
      <td><table border="0">

          <tr> 
            <td class="tdheader">Course :</td>
            <td>

<?

$Query="Select id, course, name from course_schedule where id = $parent_id";

$r=myQuery($Query);


echo $r[0][1];
?>			  </td>
          </tr>


          <tr> 
            <td class="tdheader">Schedule :</td>
            <td>

<?=$r[0][2]?>

<input type="hidden" name="Course" value="<?=$r[0][1]?>">
<input type="hidden" name="Schedule" value="<?=$r[0][2]?>">	
<input type="hidden" name="parent_id" value="<?=$parent_id?>">
<input type="hidden" name="Ccode" value="<?=$r[0][0]?>">			  </td>
          </tr>








          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Showcase?</td>
            <td>
              <?
$sourceData = array(
1,
0,
);

$sourceLabel = array(
"Yes",
"No",

);

$boxName = "showcase";

FFPRadioBox($boxName,1,$sourceData,$sourceLabel);


?>            </td>
          </tr>
          <tr> 
            <td class="tdheader">Code :</td>
            <td> <?print($Code)?> </td>
          </tr>

          <tr> 
            <td class="tdheader">Graduate :</td>
            <td><input class="text" name="Graduate" type="text" size="40"></td>
          </tr>
          <tr> 
            <td class="tdheader">Sharing Detail :</td>
            <td><textarea class="text" name="Detail" cols="40" rows="8"></textarea></td>
          </tr>
          <tr> 
            <td valign="top" class="tdheader">Publish :</td>
            <td> 
			
              <?

$sourceData = array(
  "Yes",
  "No",
  );

$boxName="Status";

$value=$Status;

FFPCheckBox("Status",$Status,$sourceData,$sourceLabel);

?>            </td> 			  
          </tr>			  

          <tr>
            <td class="tdheader">Picture :</td>
            <td><input name="Picture" type="file" class="text" id="Picture" size="45" />
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right"> <input name="image2" type="image" onclick="Redirect('menu.php?label=<?=$label?>',1);return false;" src="../../images/bt_cancel.gif" width="78" height="23"> 
        <input name="image2" type="image" src="../../images/bt_save.gif" width="76" height="22" <?print($active)?>> 
      </td>
    </tr>
  </table>
</form>
<?
require($rela_path . "inc/footer.php");
?>

